package com.lanyou.esb.common;

/**
 * 常量
 * 
 * @author Davey.wu
 */
public final class Constants4Redis {
	// 时间格式==================start====================
	public static final String DATE_PATTERN_YYYYMMDDHHMMSS = "yyyy-MM-dd HH:mm:ss";
	public static final String DATE_PATTERN_YYYYMMDD_NOSPACE = "yyyyMMdd";
	public static final String DATE_PATTERN_YYYYMMDDHHMMSS_NOSPACE = "yyyyMMddHHmmss";
	// 时间格式==================end====================
	/** 服务器时间前缀 **/
	public static final String PREFIX_COOKPROXY_SERVICE_TIME = "COOKPROXY_SERVICE_TIME";
	/** 并发数前缀 **/
	public static final String PREFIX_CONCURRENCY_NUMBER = "CONNUM";
	/** 请求响应类型（成功/失败)前缀 **/
	public static final String PREFIX_REQRESTYPE = "RRTTT";
	/** 工单前缀 **/
	public static final String PREFIX_WORKORDER = "WO";
	/** ESB总流量前缀 **/
	public static final String PREFIX_INESBTOTALTIME = "IETT";
	/** 平台吞吐量前缀 **/
	public static final String PREFIX_PFTHROUGHPUT = "PFTP";
	/** 吞吐量后缀 **/
	public static final String SUFFIX_QTY = "QTY";
	/** 请求次数后缀 **/
	public static final String SUFFIX_TIMES = "TIMES";
	/** 数量后缀 **/
	public static final String SUFFIX_NUMBER = "NUM";
	/** 更新后缀 **/
	public static final String SUFFIX_UPDATE = "UP";
	/** 重复次数后缀 **/
	public static final String SUFFIX_REPEAT = "RP";
	/** REDIS键分隔符 **/
	public static final String KEY_SEPARATOR = ":";

	/** 服务告警平均响应时间记录区间 **/
	public static final int ALARM_AVG_RES_TIMES_SECTION = 1;

	// public static final int MAX_IDLE = 100;
	// public static final int MAX_WAIT_MILLIS = 1000;
	// // public static final String REDIS_IP = "10.1.1.252";
	// //public static final String REDIS_IP = "172.26.153.197";
	// public static final String REDIS_IP = "172.26.153.197";
	// public static final int REDIS_PORT = 6379;
	
	/** 服务可用性测试HASH键 **/
	public static final String REDIS_HASH_KEY_IF_USAB_TEST = "HS_KEY_IF_USAB_TEST";

	/** 领域系统HASH键 **/
	public static final String REDIS_HASH_KEY_FS = "HS_KEY_FS";
	/** HTTP接口HASH键 **/
	public static final String REDIS_HASH_KEY_HTTP = "HS_KEY_HTTP";
	/** 接口令牌HASH键 **/
	public static final String REDIS_HASH_KEY_TOKEN = "HS_KEY_TOKEN";
	/** 服务测试接口令牌HASH键 **/
	public static final String REDIS_HASH_KEY_TOKEN_TEST = "HS_KEY_TOKEN_TEST";
	/** 接口请求量控制HASH键 **/
	public static final String REDIS_HASH_KEY_IRQ = "HS_KEY_IRQ";
	/** 接口已请求次数HASH键 **/
	public static final String REDIS_HASH_KEY_IFRT = "HS_KEY_IFRT";
	/** 接口告警持久化列表键 **/
	public static final String REDIS_LIST_KEY_ALARM_P = "LS_KEY_ALARM_P";
	/** 服务日志持久化列表键 **/
	public static final String REDIS_LIST_KEY_ACCLOG_P = "LS_KEY_ACCLOG_P";
	/** 服务平均响应时间LIST键 **/
	public static final String REDIS_LIST_KEY_IF_AVG_RES_TIMES = "LS_KEY_IF_AVG_RES_TIMES";

	/** 接口告警工单持久化列表键 **/
	public static final String REDIS_LIST_KEY_ALARM_WO = "LS_KEY_ALARM_WO";

	/** 接口告警键值LIST键 **/
	public static final String REDIS_LIST_KEY_IF_ALARM_KEYS = "LS_KEY_IF_ALARM_KEYS";
	/** 更新接口告警LIST键 **/
	public static final String REDIS_LIST_KEY_IF_ALARM_UPDATE = "LS_KEY_IF_ALARM_UPDATE";
	/** 平台吞吐量键值SET集合键 **/
	public static final String REDIS_SET_KEY_PF_THROUGHPUT = "SET_KEY_PF_THROUGHPUT_4_KEY";
	/** 接口重复告警时间间隔（秒） **/
	public static final int REDIS_TIMEOUT_IF_ALARM_REPEAT_INTERVAL = 60;

	/** 接口告警过期时间（秒） **/
	public static final int REDIS_TIMEOUT_IF_ALARM = 24 * 12 * 3600;
	/** 平台流量过期时间（秒） **/
	public static final int REDIS_TIMEOUT_PF_THROUGHPUT = 2 * 24 * 12 * 3600;
	/** 接口告警更新过期时间（秒） **/
	public static final int REDIS_TIMEOUT_IF_ALARM_REPEAT_UPDATE = 24 * 12 * 3600;
	/** 并发数过期时间（秒） **/
	public static final int REDIS_TIMEOUT_CONCURRENCY_NUMBER = 20;
	/** 接口平均响应时间过期时间（秒） **/
	public static final int REDIS_TIMEOUT_IFAVGRESTIME = 10 * 60 * 60;
	/** 日志保留在REDIS中的时间 ,以小时为单位 **/
	public static final int ACCESS_LOG_RETENTION_TIME = 1;
	/** 接口告警保留在REDIS中的时间,以小时为单位 **/
	public static final int INTERFACE_ALARM_RETENTION_TIME = 1;

	/** 流量分析时间间隔，以秒为单位 **/
	public static final int QUANTITY_ANALYSIS_INTERNAL_TIME = 5;
	/** 流量分析数据保留在REDIS中的时间（秒） ,保存1个时间的数据 **/
	public static final int QUANTITY_ANALYSIS_RETENTION_TIME = 3600;

}
